package com.elitesland.system.service;

import com.elitesland.core.exception.BusinessException;
import com.elitesland.system.entity.SysPermissionDO;
import com.elitesland.system.param.SysPermissionNewParam;
import com.elitesland.system.param.SysPermissionUpdateParam;
import com.elitesland.system.vo.AntTreeNode;
import com.elitesland.system.vo.SysPermissionVO;

import java.util.List;
import java.util.Optional;
import java.util.Set;

/**
 * <pre>
 * [功能说明]
 * </pre>
 *
 * @author Mir
 * @date 2020/7/5
 */
public interface SysPermissionService {

    Long createMenu(SysPermissionNewParam permission) throws BusinessException;

    Long createAction(SysPermissionNewParam permission) throws BusinessException;

    void update(SysPermissionUpdateParam perm);

    List<AntTreeNode> listAllMenuTree();

    List<AntTreeNode> listAllMenuWithActionTree();

    List<AntTreeNode> listAllMenuWithActionTree(Long permId);

    Set<SysPermissionDO> listAllPermissionsByIds(List<Long> ids);

    List<AntTreeNode> listPermTreeByIds(List<Long> ids);

    Optional<SysPermissionVO> getById(Long id);

    List<SysPermissionVO> listActionsByMenuId(Long id);
}
